Repository navigation
test(mcpx): poll for the fake daemon's marker in TestEnsureDaemonNeverReadyStillTimesOut (dezren39/nix#445) - #335
Merged
Conversation
…rReadyStillTimesOut (dezren39/darwin-nix#445) The test asserted the marker file the instant EnsureDaemon returned at the 1s connect timeout, but the spawn is cmd.Start + Release: Start returns before the child has run any code, so the child's touch can legitimately land after the return — the same race dezren39/darwin-nix#428 fixed in TestEnsureDaemonCancelWhilePolling. Poll for the marker (10ms, 5s deadline) and fail only if it never appears. Reproduced deterministically with the dezren39/darwin-nix#428 amplification technique (fake daemon's touch delayed 2s): pre-fix FAIL at the instant stat, post-fix PASS. Origin issue for the set: dezren39/darwin-nix#445
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Origin issue (cross-repo set): dezren39/darwin-nix#445
This repo's
pkgs/mcpxcopy has the same test as dezren39/darwin-nix#445, written independently in this repo's #437 port, with the identical defect:TestEnsureDaemonNeverReadyStillTimesOutasserts the fake daemon's marker file with a singleos.Statthe instantEnsureDaemonreturns at the 1s connect timeout. The spawn iscmd.Start()+Process.Release()(client.go), so the child can legitimately not have run itstouchyet — the identical race dezren39/darwin-nix#428 fixed in its polling test.Fix (test-only, +18/−2): poll for the marker every 10ms up to a 5s deadline and fail only if it never appears — the dezren39/darwin-nix#428 pattern.
Verification:
touchdelayed 2s in a scratch copy): pre-fix FAILensuredaemon_test.go:92: the fake daemon was never spawned(1.03s); with this fix the same delayed construction PASSes (2.06s).-count=3PASS; fullgo test ./internal/cli/ -count=1PASS (23.0s);go vet ./internal/cli/clean; gofmt clean.Companion PR in dezren39/nix carries the same fix for that copy and closes the origin issue.
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit